/*
*  Copyright 2019-2025 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.hua.api.modules.express.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author express
* @date 2025-07-21
**/
@Entity
@Data
@Table(name="express_info")
public class ExpressInfo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`express_name`")
    @ApiModelProperty(value = "配送渠道名")
    private String expressName;

    @Column(name = "`img_path`")
    @ApiModelProperty(value = "图片")
    private String imgPath;

    @Column(name = "`express_code`")
    @ApiModelProperty(value = "渠道常量唯一")
    private String expressCode;

    @Column(name = "`geo_type`")
    @ApiModelProperty(value = "店铺使用的坐标系")
    private String geoType;

    @Column(name = "`state`")
    @ApiModelProperty(value = "状态")
    private String state;

    @Column(name = "`api_state`")
    @ApiModelProperty(value = "api状态")
    private String apiState;

    @Column(name = "`auth_json`")
    @ApiModelProperty(value = "授权信息")
    private String authJson;

    @Column(name = "`express_desc`")
    @ApiModelProperty(value = "备注")
    private String expressDesc;

    @Column(name = "`sale_after`")
    @ApiModelProperty(value = "是否支持售后单配送")
    private Integer saleAfter;

    public void copy(ExpressInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
